package com.zoo.diannaopeijian.service.impl;

import com.zoo.diannaopeijian.comm.page.Page;
import com.zoo.diannaopeijian.domain.ExportChannel;
import com.zoo.diannaopeijian.domain.ExportChannelExample;
import com.zoo.diannaopeijian.mapper.ExportChannelMapper;
import com.zoo.diannaopeijian.service.ExportChannelService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by zx583 on 2018-01-28.
 */
@Service
public class ExportChannelServiceImpl implements ExportChannelService {
    @Resource
    private ExportChannelMapper exportChannelMapper;

    @Override
    public boolean addExportChannel(ExportChannel exportChannel) {
        return exportChannelMapper.insertSelective(exportChannel) == 1;
    }

    @Override
    public boolean deleteExportChannel(Integer exportchannelid) {
        return exportChannelMapper.deleteByPrimaryKey(exportchannelid) == 1;
    }

    @Override
    public boolean updateExportChannel(ExportChannel exportChannel) {
        return exportChannelMapper.updateByPrimaryKeySelective(exportChannel) == 1;
    }

    @Override
    public List<ExportChannel> getAllExportChannel(Page page) {
        if (page != null) {
            page.onPage();
        }
        return exportChannelMapper.selectByExample(new ExportChannelExample());
    }
}
